package com.lyloou.server;

import java.io.IOException;

public interface Serializer {

    /**
     * \* java对象转换为二进制
     * <p>
     * <p>
     * <p>
     * \* @param object
     * <p>
     * \* @return
     */

    byte[] serialize(Object object) throws IOException;


    /**
     * \* 二进制转换成java对象
     * <p>
     * <p>
     * <p>
     * \* @param clazz
     * <p>
     * \* @param bytes
     * <p>
     * \* @param <T>
     * <p>
     * \* @return
     */

    <T> T deserialize(Class<T> clazz, byte[] bytes) throws IOException;

}